Skip to content

Conversation

@yuchen-db
Copy link
Collaborator

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

Verification

yuchen-db and others added 10 commits January 29, 2026 16:56
Creation of the index header shares the underlying storage so we should
use singleflight here to only create it once.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
(cherry picked from commit 4b31bba)
Signed-off-by: 🌲 Harry 🌊 John 🏔 <johrry@amazon.com>
(cherry picked from commit ba255aa)
Protect reads and writes with the mutex.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
(cherry picked from commit ebd746c)
I don't see any reason why this must not be blocking - on boot we load
up all tenants and open up their TSDBs. This is blocking.

When receiving a request, a spin up a new goroutine (currently) to open
the TSDB. By definition, that new TSDB will be completely empty because
we already load pre-existing TSDBs on boot.

Init the TSDB only once with a singleflight group.

Fixes thanos-io#8446.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
(cherry picked from commit d54b40c)
The current implementation prunes tenants first and then updates
`t.tenants`. TSDB clients are gathered from the `t.tenants` map. If a
Series() call comes in the middle then the Querier could get an error
like the following:

```
open chunk reader: can't read from a closed head
```

This commit tries to fix that by adding a "readOnly" mode where just
before closing we now turn it on. It ensures that all RecvMsg() calls
just return io.EOF.

Also, did various tuning to tests so that they would pass more reliably.
Now the first request doesn't fail. Adjust for that.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
(cherry picked from commit a7f04c2)
Deleting one by one is REALLY slow if you have thousands of blocks to
delete. Use some concurrency by default.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
(cherry picked from commit bbe9710)
Signed-off-by: adezxc <adam.jasinski@vinted.com>
(cherry picked from commit d05e90a)
…ed due to corrupt file or other errors (thanos-io#8480)

Co-authored-by: Ben Ye <benye@amazon.com>
(cherry picked from commit 094aa1d)
Signed-off-by: Michael Hoffmann <mhoffmann@cloudflare.com>
(cherry picked from commit b9d06d4)
Signed-off-by: Michael Hoffmann <mhoffmann@cloudflare.com>
(cherry picked from commit d52bc93)
@yuchen-db yuchen-db force-pushed the yuchen-db/upstream-fix branch from 3108617 to 820edcf Compare January 30, 2026 05:05
Implement batching of series responses in gRPC to reduce overhead.
Based on upstream commits 44c0fda and 49dde50.

Changes:
- Add batchable server wrapper that batches series into single messages
- Handle batch responses in lazy and eager resp sets
- Add ResponseBatchSize field propagation through proxy
- Add flush chaining in flushable servers
- Add unit tests for batch response handling

Also fixes pre-existing build issues from previous cherry-picks:
- Fix wg.Go() usage (Go 1.22+ only) in fetcher.go, blocks_cleaner.go,
  inprocess_test.go
- Fix ulid.Bytes() -> ulid[:] for ulid v1 compatibility
- Fix duplicate slices import in acceptance_test.go
- Regenerate protobuf files

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@yuchen-db yuchen-db force-pushed the yuchen-db/upstream-fix branch from 820edcf to 2dd2481 Compare January 30, 2026 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant